<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./Promise.js"></script>
</head>
<body>
    <h1>手写Promise的状态只能改变一次</h1>

    <script>
         
        // 实例化一个自定义的Promise对象
        const p = new Promise((resolve, reject) => {
            resolve("ok"); //成功
            reject("error"); //失败
        
        });

        console.log(p);
        

    </script>
</body>
</html>